<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id('id');
            $table->string('openid',100)->comment('用户唯一标识');
            $table->string('name',50)->comment('昵称')->default('游客用户');
            $table->string('phone',50)->comment('手机号')->nullable();
            $table->enum('sex',['0','1','2'])->comment('性别0女1男2保密')->default('2');
            $table->string('icon',250)->comment('头像')->default('http://ruwjymzbj.hn-bkt.clouddn.com/touxiang-kong.png');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
